import { getCart } from '@/utils/apis/cart'
interface State {
    count: number;
}
const state: State = {
    count: 0,
};
const mutations = {
    setCount(state: State, count: number) {
        state.count = count;
    }
}
const actions: any = {
    async getGoodsCount({ commit }: any) {
        const res = await getCart();
        commit('setCount', res.data.length);
    }
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
};